// 封装各种modal的状态，增加多国化代码，减少每个page/component重复写的情况

import language from "../../api/language";

export default {
    getTranslate(posIndex){
        let langDict = language.getTranslate(language.SystemModal)
        if (posIndex === 0){
            return langDict.titleTip
        }else if(posIndex === 1){
            return langDict.titleError
        }else if(posIndex === 2){
            return langDict.redirectError
        }
    },

    redirectErrorModal(content, showCancel = false){
        uni.showModal({
            title: this.getTranslate(1),
            content: this.getTranslate(2) + ': ' + content,
            showCancel: showCancel
        })
    }
}
